package creational.singleton;

/**
 * 懒汉式单例，采用了时间换空间的方式进行，每次都需要执行同步代码块
 */
public class LazySingleton {
    private static LazySingleton singletom;

    private LazySingleton() {

    }

    public static synchronized LazySingleton getInstance() {
        if (singletom == null){
            singletom = new LazySingleton();
        }

        return singletom;
    }

}
